<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../day1/lib/vue-2.6.12.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            padding: 30px;
        }
        #app{
            background-color:orange;
        }
        #zi{
            background-color: blueviolet;
        }
        #sun{
            background-color:brown;
        }
    </style>
</head>
<body>
    <div id="app" @click.capture="fuClick">父
        <div id="zi" @click.capture="ziClick">子
            <div id="sun" @click.capture="sunClick">孙</div>
        </div>
    </div>
    <script>
        let vm=new Vue({
            el:'#app',
            methods:{
                fuClick(){
                    console.log('父元素被点击了');
                },
                ziClick(){
                    console.log('子元素被点击了');
                },
                sunClick(){
                    console.log('孙元素被点击了');
                }   
            }
        })
    </script>
</body>
</html>